import React from "react";

export default class LearnJSX extends React.Component {
  name = "张三";

  renderTitle = (<h1>我是h1标题</h1>);

  is = true;

  render() {
    return (
      <div>
        <div>你好，我是jsx</div>

        {/* 
          在jsx里面变量放到{}里面
        */}
        <div>{this.name}</div>

        <div>{this.renderTitle}</div>

        <div>{!this.is ? "is 是true" : " is是 false"}</div>

        <div>

          {
            this.is ? <h2>成立h2标题</h2> : ''
          }
        </div>
      </div>
    );
  }
}
